home *** CD-ROM | disk | FTP | other *** search
/ PC Team 23 / HS_Tuning.iso / Optimisation / JV16 Powertools 1.6 / Setup.exe / {app} / Documentation / Example Scripts / 4. Real world examples / Date and time report.jvb < prev    next >
Encoding:
Text File  |  2003-04-22  |  1.5 KB  |  55 lines

  1. Define DateTime;
  2. DateTime := [date];
  3.  
  4. Define OnlyDate;
  5. Define OnlyTime;
  6.  
  7. //The Date command returns the date in the following format: DD.MM.YYYY, HH:MM
  8. //So, lets copy the data from it. First, the actual time from the end:
  9. OnlyTime := [sCopy 12 100 $DateTime];
  10.  
  11.  
  12. Define Month;
  13. Define MonthNum;
  14.  
  15. //And then the current month's number
  16. MonthNum := [sCopy 4 2 $DateTime];
  17.  
  18. //This is such a cool script it even translates the numerical date information to plain English
  19. If ($MonthNum = 01) [ Month := "January"; ]
  20. If ($MonthNum = 02) [ Month := "February"; ]
  21. If ($MonthNum = 03) [ Month := "March"; ]
  22. If ($MonthNum = 04) [ Month := "April"; ]
  23. If ($MonthNum = 05) [ Month := "May"; ]
  24. If ($MonthNum = 06) [ Month := "June"; ]
  25. If ($MonthNum = 07) [ Month := "July"; ]
  26. If ($MonthNum = 08) [ Month := "August"; ]
  27. If ($MonthNum = 09) [ Month := "September"; ]
  28. If ($MonthNum = 10) [ Month := "October"; ]
  29. If ($MonthNum = 11) [ Month := "November"; ]
  30. If ($MonthNum = 12) [ Month := "December"; ]
  31.  
  32. Define Day;
  33. Define DayNum;
  34.  
  35. //And finally, lets copy the current day's number
  36. DayNum := [sCopy 1 2 $DateTime];
  37.  
  38. //1st
  39. //2nd
  40. //3rd
  41. //4th
  42. //5th
  43. //6th
  44. //..
  45.  
  46. //And lets also translate it to English
  47. If ($DayNum = 01) [Day := "1st";]
  48. If ($DayNum = 02) [Day := "2nd";]
  49. If ($DayNum = 03) [Day := "3rd";]
  50.  
  51. //And all the rest follows the pattern DayNum + "th", so:
  52. If ($DayNum > 03) [Day := [CombVar DayNum th]; ]
  53.  
  54.  
  55. ShowMessage The clock is $OnlyTime and today is the $Day of $Month.;